import { pinyin } from "pinyin-pro";
import { useState } from "react"; 
const Zjm = () => {
  const [text, setText] = useState('');
  const zjm = (val) => {
    const zhuji = pinyin(val, { type: 'array' })
    let upperzhu = ''
    zhuji.forEach(z => {
        upperzhu += z.charAt(0)
    })
    let Sp = upperzhu.toUpperCase()
    console.log("🚀 ~ zjm ~ Sp:", Sp)
}
return <div>  
    <input type="text" onChange={(e) => zjm(e.target.value)}/> 
  </div>;
};

export default Zjm;